//
//  ZoomButtonView.swift
//  ERecycle-Shop
//
//  Created by abb on 16/8/15.
//  Copyright © 2016年 abb. All rights reserved.
//

import UIKit

class ZoomButtonView: UIView {
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
        backgroundColor = UIColor.whiteColor()
        layer.borderWidth = 0.5
        layer.cornerRadius = 4
        layer.borderColor = UIColor.lightGrayColor().CGColor
        
    }
    
    private func setupUI() {
        addSubview(addZoomBtn)
        addSubview(splitLine)
        addSubview(subZoomBtn)
        
        splitLine.snp_makeConstraints { (make) in
            make.width.equalTo(self).multipliedBy(0.6)
            make.height.equalTo(0.5)
            make.center.equalTo(self)
        }
        addZoomBtn.snp_makeConstraints { (make) in
            make.top.left.right.equalTo(self)
            make.bottom.equalTo(splitLine.snp_bottom)
        }
        subZoomBtn.snp_makeConstraints { (make) in
            make.top.equalTo(splitLine.snp_bottom)
            make.left.right.bottom.equalTo(self)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    /// 增加缩放
    lazy var addZoomBtn:UIButton = UIButton(imageName: "add", bgColor: UIColor.whiteColor())
    /// 分割线
    private lazy var splitLine:UIView = UIView.splitLine(UIColor.grayColor())
    /// 减小缩放
    lazy var subZoomBtn:UIButton = UIButton(imageName: "subtract", bgColor: UIColor.whiteColor())

}
